Skip to content

Linux portduino arch#1137

Open
ggodlewski wants to merge 5 commits intomeshcore-dev:devfrom
ggodlewski:linux
Open

Linux portduino arch#1137
ggodlewski wants to merge 5 commits intomeshcore-dev:devfrom
ggodlewski:linux

Conversation

@ggodlewski
Copy link
Copy Markdown

This PR allow to run MC on rpi zero 2w, running debian 13.

See https://github.com/ggodlewski/MeshCore/blob/linux/variants/linux/README.md for instruction and remarks.

I have RPI with POW + 2 * SX1262 running both MC and MT at the same time.

Resolves: #619

@ggodlewski ggodlewski changed the base branch from main to dev November 21, 2025 18:11
@Cisien
Copy link
Copy Markdown

Cisien commented Nov 25, 2025

Nice! I look forward to this!

Comment thread examples/simple_room_server/MyMesh.cpp Outdated
#if defined(NRF52_PLATFORM)
return _fs->open(fname, FILE_O_WRITE);
#elif defined(RP2040_PLATFORM)
#elif defined(RP2040_PLATFORM) || defined(ARCH_PORTDUINO)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it maybe time to move fs access either to the board abstraction, or to its own abstraction so we can avoid all of the platform checks in the main code? @ripplebiz ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also have a look at this one: https://github.com/meshcore-dev/MeshCore/pull/1137/files/53d53fbb34f578b1bbcdfa86a3b4f8d9d8b3eb16#diff-37ca67c35b6bde867acedc3db6bb9eab58c5533e69de348a1688383af4f1645fR67

I added config to linux board. It would be useful to have config in any board. Currently examples are still using defines for node name, position, etc.

I didn't touch it because it would be rude to alter so many files in the first PR ;)

Comment thread examples/simple_repeater/MyMesh.cpp Outdated

void MyMesh::dumpLogFile() {
#if defined(RP2040_PLATFORM)
#if defined(RP2040_PLATFORM) || defined(ARCH_PORTDUINO)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we name this PORTDUINO_PLATFORM to be more in line with the other defines?

Comment thread examples/simple_repeater/MyMesh.cpp
Comment thread boards/linux.json
@l5yth
Copy link
Copy Markdown

l5yth commented Dec 20, 2025

Hey, this is great work!

I have a Raspberry Pi 4B with a Waveshare LoRa hat.

root@orion ~/meshcore-ggodlewski linux*
❯ /usr/bin/meshcored --fsdir /var/lib/meshcore
Portduino is starting, VFS root at /var/lib/meshcore
SPI begin /dev/spidev0.0
Radio begin 869.617981 62.500000 8 8 1.800000
ERROR: radio init failed: -2

I tried to use your code to port over the "known working" config from Meshtastic but I get the same error. I'll take a look. I really would love to get Meshcore working on native Linux devices.

Edit: I got it to work with my LoRa hat. It just needed "more" configuration. Please take a lookg @ggodlewski ggodlewski#1

@ggodlewski ggodlewski force-pushed the linux branch 2 times, most recently from 73c18ea to 55e422f Compare December 28, 2025 09:56
@ggodlewski ggodlewski force-pushed the linux branch 3 times, most recently from 50f4ed4 to f21cf85 Compare December 28, 2025 12:04
@ggodlewski
Copy link
Copy Markdown
Author

@l5yth thanks, I think now I know why performance of my sx1262 is so low.
I was not able to merge your PR so I just applied changes manually.
Everything should be configurable at runtime. Let my know if it works with our hat.

@ggodlewski ggodlewski requested a review from Cisien December 28, 2025 12:17
@l5yth
Copy link
Copy Markdown

l5yth commented Dec 31, 2025

LGTM on Waveshare LoRa hat

_ meshcored --fsdir /var/lib/meshcore 
Portduino is starting, VFS root at /var/lib/meshcore
SPI begin /dev/spidev0.0
LoRa pins NSS=21 BUSY=20 IRQ=16 RESET=18 TX=-1 RX=-1
Radio begin 869.617981 62.500000 8 8 1.800000
Repeater ID: 63E822CAEE5548B7CB891F002F032247C1F54B08CEC4E39EAD2450F5C06E6AE2
09:44:07 - 31/12/2025 U: TX, len=133 (type=4, route=F, payload_len=131)
09:45:51 - 31/12/2025 U: TX, len=133 (type=4, route=D, payload_len=131)

Copy link
Copy Markdown

@Cisien Cisien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still like to get feedback from @ripplebiz about abstracting storage into the board config to avoid all of the little edits that need to be made everywhere, but that doesn't need to be a change that's tackled for this. I think it's fine as-is, but this is just highlighting some debt this project has.

@Habbie
Copy link
Copy Markdown

Habbie commented Jan 29, 2026

Tested (PR head, unmerged) on a Nebra Outdoor Miner with the wio sx1262 breadboard setup documented at https://helium-repurposed.deobfuscated.org/Miners/Nebra%20Outdoor . Repeats just fine!

I hope somebody does companion next!

@ggodlewski
Copy link
Copy Markdown
Author

@Habbie it should be trivial, just copy/paste few lines from router.
I was thinking about one single app with runtime config, but there is not point of spending time if this PR is rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for native Linux devices (i.e. Pi Zero 2)

5 participants